package com.xxx.springboot.constant;

/**
 * redis相关常量类
 */
public class RedisConstants {
	
	/**
	 * redis key前缀
	 */
	private static final String REDIS_KEY_PREFIX = "demo:";

	/**
	 * test key
	 */
	public static final String REDIS_KEY_TEST = REDIS_KEY_PREFIX + "test:{0}";
	
    /**
     * 用户ID
     * {0}为日期YYYYMMDD， {1}为userId
     */
    public static final String USERID = "userId:{0}:{1}";
    
	/**
     * 用户登录token
     * {0}为token
     */
    public static final String REDIS_KEY_TOKEN = REDIS_KEY_PREFIX + "token:{0}";
    
    /**
     * 用户ID对应的token
     * {0}为userId
     */
    public static final String REDIS_KEY_USER_TOKEN = REDIS_KEY_PREFIX + "usertoken:{0}";
    
	/**
     * nonce
     * {0}为nonce，{1}为fingerprint
     */
    public static final String REDIS_KEY_NONCE = REDIS_KEY_PREFIX + "nonce:{0}:{1}";
    
	/**
     * 接口调用次数
     * {0}为接口名，{1}为设备指纹
     */
    public static final String REDIS_KEY_FINGERPRINT = REDIS_KEY_PREFIX + "fingerprint:{0}:{1}";
    
	/**
     * 用户名密码输入错误次数
     * {0}为userId
     */
    public static final String REDIS_KEY_WRONG_TIMES = REDIS_KEY_PREFIX + "wrongtimes:{0}";

    /**
     * 短信验证码
     * {0}为手机号
     */
    public static final String REDIS_KEY_VERICODE_SMS = REDIS_KEY_PREFIX + "vericode:sms:{0}";

    /**
     * 图片验证码
     * {0}为uuid
     */
    public static final String REDIS_KEY_VERICODE_IMG = REDIS_KEY_PREFIX + "vericode:img:{0}";

    /**
     * 短信次数
     * {0}为手机号
     */
    public static final String REDIS_KEY_SMS_TIMES = REDIS_KEY_PREFIX + "smstimes:{0}";

    /**
     * 国际短信次数
     * {0}为手机号
     */
    public static final String REDIS_KEY_IN_SMS_TIMES = REDIS_KEY_PREFIX + "insmscnt:{0}";

    /**
     * 坐标点集合
     */
    public static final String REDIS_KEY_GEO_POINTS = REDIS_KEY_PREFIX + "geo_points";

}
